import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpQuestionItem {
  id!: number;
  questionId!: number;
  title!: unknown;
  type!: number;
  questionData?: unknown;
  answerData?: unknown;
  analysis?: unknown;
  addTime!: string;
  updateTime!: string;
  uniacid!: number;
  score!: number;
  sort: number = 0;
  chaosMate?: number;
  yesNum: number = 0;
  wrongNum: number = 0;
}

export const ImsYzdKpQuestionItemSchema = new EntitySchema({
  class: ImsYzdKpQuestionItem,
  properties: {
    id: { primary: true, type: 'number' },
    questionId: { type: 'number' },
    title: { type: 'unknown', columnType: 'longtext' },
    type: { type: 'number' },
    questionData: { type: 'unknown', columnType: 'longtext', nullable: true },
    answerData: { type: 'unknown', columnType: 'longtext', nullable: true },
    analysis: { type: 'unknown', columnType: 'longtext', nullable: true },
    addTime: { type: 'string', length: 255 },
    updateTime: { type: 'string', length: 255 },
    uniacid: { type: 'number' },
    score: { type: 'number' },
    sort: { type: 'number', default: 0 },
    chaosMate: { type: 'number', columnType: 'tinyint', nullable: true },
    yesNum: { type: 'number', default: 0 },
    wrongNum: { type: 'number', default: 0 },
  },
});
